﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DirectMeterialModify.aspx.cs" Inherits="Hisun.View.Meterial.DirectMeterialModify" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
       <div class =" CommonPage_MainPanel">
    <div class ="CommonPage_Banner"><div class = "CommomPage_Title">生产原辅料调整</div></div>
    <div class ="CommonPage_Body">

     <table >
            <tr>
                <td class="style9" colspan="5">
                   
                </td>
            </tr>
            <tr>
                <td class="style9">
                    <asp:Label ID="Label2" runat="server" Text="作业中心：" SkinID="Label"></asp:Label>
                    <asp:DropDownList ID="dropCostCenterSelect" runat="server" AutoPostBack="True" 
                        Height="21px" Width="180px" SkinID="DropdownList">
                    </asp:DropDownList>
                    <asp:Label ID="Label1" runat="server" Text="作业中心产品：" SkinID="Label"></asp:Label>
                    <asp:DropDownList ID="DropDownListSelectProductInProccess" runat="server" 
                        AutoPostBack="True" DataSourceID="LinqDataSource_ProductInProcess" 
                        DataTextField="中间体名称" DataValueField="中间体ID" Height="17px" Width="180px" 
                        SkinID="DropdownList">
                    </asp:DropDownList>
                    <asp:Label ID="Label5" runat="server" SkinID="Label" Text="会计期间ID："></asp:Label>
                    <asp:TextBox ID="TextBox_AccountPeriod" runat="server" SkinID="TextBox" 
                        Width="80px"></asp:TextBox>
                    <asp:CheckBox ID="CheckBox_Shift" runat="server" SkinID="CheckBox" 
                        Text="仅手工调整" />
                    <asp:Button SkinID = "Button" ID="Button_Query" runat="server" onclick="Button_Query_Click" 
                        Text="查询" />
                </td>
                <td class="style5">
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style7">
                    &nbsp;</td>
                <td class="style4">
                    <asp:Button SkinID = "Button" ID="Button_Add" runat="server" onclick="Button_Add_Click" 
                        Text="新增" />
                </td>
            </tr>
            <tr>
                <td class="style2" colspan="5">
                    <asp:GridView ID="GridView_Meterial" runat="server" SkinID = "GridView"  AutoGenerateColumns="False" 
                        DataKeyNames="ID" onrowdatabound="GridView_Meterial_RowDataBound" 
                        ShowFooter="True">
                        <Columns>
                            <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" 
                                SortExpression="ID" Visible="False" />
                            <asp:BoundField DataField="材料ID" HeaderText="材料ID" ReadOnly="True" 
                                SortExpression="材料ID" />
                            <asp:BoundField DataField="材料名称" HeaderText="材料名称" />
                            <asp:BoundField DataField="计量单位" HeaderText="计量单位" ReadOnly="True" 
                                SortExpression="计量单位" />
                            <asp:BoundField DataField="期初数量" HeaderText="期初数量" DataFormatString="{0:F4}" />
                            <asp:BoundField DataField="期初金额" HeaderText="期初金额" DataFormatString="{0:F2}" />
                            <asp:TemplateField HeaderText="领用数量" SortExpression="领用数量">
                                <EditItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("领用数量", "{0:F2}") %>'></asp:Label>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:TextBox ID="TextBox_GetValue" runat="server" 
                                        Text='<%# string.Format("{0:F4}",Eval("领用数量")) %>' ValidationGroup="Group" 
                                        SkinID="TextBox" Width="80px"></asp:TextBox>
                                    <asp:CompareValidator ID="CompareValidator2" runat="server" 
                                        ControlToValidate="TextBox_GetValue" ErrorMessage="*" Operator="DataTypeCheck" 
                                        Type="Double" ValidationGroup="Group"></asp:CompareValidator>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="领用金额" SortExpression="领用金额">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:TextBox ID="TextBox_GetMoney" runat="server" SkinID="TextBox" 
                                        Text='<%# string.Format("{0:F2}",Eval("领用金额")) %>' Width="80px"></asp:TextBox>
                                    <asp:CompareValidator ID="CompareValidator_GetMoney" runat="server" 
                                        ControlToValidate="TextBox_GetValue" ErrorMessage="*" Operator="DataTypeCheck" 
                                        Type="Double" ValidationGroup="Group"></asp:CompareValidator>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="本期耗用" HeaderText="本期耗用" ReadOnly="True" 
                                SortExpression="本期耗用" DataFormatString="{0:F4}" />
                            <asp:BoundField DataField="耗用金额" HeaderText="耗用金额" DataFormatString="{0:F2}" />
                            <asp:TemplateField HeaderText="期末数量" SortExpression="期末数量">
                                <EditItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("期末数量") %>'></asp:Label>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:TextBox ID="TextBox_FinalValue" runat="server" 
                                        Text='<%# string.Format("{0:F4}",Eval("期末数量")) %>' ValidationGroup="Group" 
                                        SkinID="TextBox" Width="80px"></asp:TextBox>
                                    <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                        ControlToValidate="TextBox_FinalValue" ErrorMessage="*" 
                                        Operator="DataTypeCheck" Type="Double" ValidationGroup="Group"></asp:CompareValidator>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="期末金额" HeaderText="期末金额" DataFormatString="{0:F2}" />
                            <asp:BoundField DataField="手工调整" HeaderText="手工调整" />
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Button SkinID = "Button" ID="Button_Del" runat="server" CommandArgument='<%# Eval("ID") %>' 
                                        onclientclick="return confirm('确定删除当前记录吗？')" oncommand="Button_Del_Command" 
                                        Text="删除" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td class="style2" colspan="5">
                    <asp:Button SkinID = "Button" ID="Button_Save_1" runat="server" Text="保存" 
                        ValidationGroup="Group" onclick="Button_Save_Click" Visible="False" />
                    <asp:LinqDataSource ID="LinqDataSource_ProductInProcess" runat="server" 
                        ContextTypeName="Hisun.Models.HisunDBDataContext" Select="new (中间体ID, 中间体名称)" 
                        TableName="TABC_JS_ProductInProcess" 
                        Where="作业中心ID == @作业中心ID &amp;&amp; 可用 == @可用">
                        <WhereParameters>
                            <asp:ControlParameter ControlID="dropCostCenterSelect" Name="作业中心ID" 
                                PropertyName="SelectedValue" Type="Int32" />
                            <asp:Parameter DefaultValue="True" Name="可用" Type="Boolean" />
                        </WhereParameters>
                    </asp:LinqDataSource>
                    <asp:HiddenField ID="HiddenField_CenterId" runat="server" />
                    <asp:HiddenField ID="HiddenField_PIPId" runat="server" />
                    <asp:HiddenField ID="HiddenField_Ap" runat="server" />
                    <br />
                </td>
            </tr>
        </table>
    </div></div>
    </form>
</body>
</html>
<% =alert %>